package kr.hkit.androidcomplete02.ch13;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.Toast;
import android.widget.CalendarView.OnDateChangeListener;

public class CalendarViewEx extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_calendarviewex);

		CalendarView calendar = (CalendarView) findViewById(R.id.ch13_calendar);
		calendar.setOnDateChangeListener(new OnDateChangeListener() {
			public void onSelectedDayChange(CalendarView view, int year,
					int month, int dayOfMonth) {
				Toast.makeText(CalendarViewEx.this,
						year + "/" + (month + 1) + "/" + dayOfMonth,
						Toast.LENGTH_SHORT).show();
			}
		});
	}
}
